﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace TAS
{
    public class Logger
    {
        FileStream m_OutputFile = null;
        StreamWriter m_StreamWriter = null;

        public void Initialize( string file )
        {
            m_OutputFile = new FileStream(file, FileMode.Append, FileAccess.Write);
            m_StreamWriter = new StreamWriter(m_OutputFile);
        }

        public void Log(string text)
        {
            m_StreamWriter.WriteLine(text);
            m_StreamWriter.Flush();
        }

        public void Close()
        {
            m_StreamWriter.Close();
            m_OutputFile.Close();
        }
    }
}
